From 98a500a43427c67735cd870bb05d40032b6defec Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sat, 29 Oct 2016 21:11:23 +0200 Subject: [PATCH] inspector: Add outline for a new "recorder" tab --- gtk/inspector/Makefile.inc | 3 +++ gtk/inspector/init.c | 4 +++ gtk/inspector/recorder.c | 46 ++++++++++++++++++++++++++++++++++ gtk/inspector/recorder.h | 51 ++++++++++++++++++++++++++++++++++++++ gtk/inspector/recorder.ui | 25 +++++++++++++++++++ gtk/inspector/window.c | 1 + gtk/inspector/window.h | 1 + gtk/inspector/window.ui | 17 +++++++++++++ 8 files changed, 148 insertions(+) create mode 100644 gtk/inspector/recorder.c create mode 100644 gtk/inspector/recorder.h create mode 100644 gtk/inspector/recorder.ui diff --git a/gtk/inspector/Makefile.inc b/gtk/inspector/Makefile.inc index 7641d3a9e5..61adc3822c 100644 --- a/gtk/inspector/Makefile.inc +++ b/gtk/inspector/Makefile.inc @@ -19,6 +19,7 @@ inspector_c_sources = \ inspector/object-tree.c \ inspector/prop-editor.c \ inspector/prop-list.c \ + inspector/recorder.c \ inspector/resource-list.c \ inspector/selector.c \ inspector/signals-list.c \ @@ -49,6 +50,7 @@ inspector_h_sources = \ inspector/object-tree.h \ inspector/prop-editor.h \ inspector/prop-list.h \ + inspector/recorder.h \ inspector/resource-list.h \ inspector/selector.h \ inspector/signals-list.h \ @@ -71,6 +73,7 @@ inspector_templates = \ inspector/object-hierarchy.ui \ inspector/object-tree.ui \ inspector/prop-list.ui \ + inspector/recorder.ui \ inspector/resource-list.ui \ inspector/selector.ui \ inspector/signals-list.ui \ diff --git a/gtk/inspector/init.c b/gtk/inspector/init.c index 53a9b9e472..159c1f002b 100644 --- a/gtk/inspector/init.c +++ b/gtk/inspector/init.c @@ -38,6 +38,7 @@ #include "object-hierarchy.h" #include "object-tree.h" #include "prop-list.h" +#include "recorder.h" #include "resource-list.h" #include "selector.h" #include "signals-list.h" @@ -56,6 +57,8 @@ gtk_inspector_init (void) { static GIOExtensionPoint *extension_point = NULL; + g_type_ensure (G_TYPE_LIST_STORE); + g_type_ensure (GTK_TYPE_CELL_RENDERER_GRAPH); g_type_ensure (GTK_TYPE_GRAPH_DATA); g_type_ensure (GTK_TYPE_INSPECTOR_ACTIONS); @@ -71,6 +74,7 @@ gtk_inspector_init (void) g_type_ensure (GTK_TYPE_INSPECTOR_OBJECT_HIERARCHY); g_type_ensure (GTK_TYPE_INSPECTOR_OBJECT_TREE); g_type_ensure (GTK_TYPE_INSPECTOR_PROP_LIST); + g_type_ensure (GTK_TYPE_INSPECTOR_RECORDER); g_type_ensure (GTK_TYPE_INSPECTOR_RESOURCE_LIST); g_type_ensure (GTK_TYPE_INSPECTOR_SELECTOR); g_type_ensure (GTK_TYPE_INSPECTOR_SIGNALS_LIST); diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c new file mode 100644 index 0000000000..c545552b63 --- /dev/null +++ b/gtk/inspector/recorder.c @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2014 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ + +#include "config.h" +#include + +#include "recorder.h" + +struct _GtkInspectorRecorderPrivate +{ + GListStore *recordings; +}; + +G_DEFINE_TYPE_WITH_PRIVATE (GtkInspectorRecorder, gtk_inspector_recorder, GTK_TYPE_BIN) + +static void +gtk_inspector_recorder_class_init (GtkInspectorRecorderClass *klass) +{ + GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass); + + gtk_widget_class_set_template_from_resource (widget_class, "/org/gtk/libgtk/inspector/recorder.ui"); + + gtk_widget_class_bind_template_child_private (widget_class, GtkInspectorRecorder, recordings); +} + +static void +gtk_inspector_recorder_init (GtkInspectorRecorder *vis) +{ + gtk_widget_init_template (GTK_WIDGET (vis)); +} + +// vim: set et sw=2 ts=2: diff --git a/gtk/inspector/recorder.h b/gtk/inspector/recorder.h new file mode 100644 index 0000000000..7684a7c1a9 --- /dev/null +++ b/gtk/inspector/recorder.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2014 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ + +#ifndef _GTK_INSPECTOR_RECORDER_H_ +#define _GTK_INSPECTOR_RECORDER_H_ + +#include + +#define GTK_TYPE_INSPECTOR_RECORDER (gtk_inspector_recorder_get_type()) +#define GTK_INSPECTOR_RECORDER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_INSPECTOR_RECORDER, GtkInspectorRecorder)) +#define GTK_INSPECTOR_RECORDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_INSPECTOR_RECORDER, GtkInspectorRecorderClass)) +#define GTK_INSPECTOR_IS_RECORDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_TYPE_INSPECTOR_RECORDER)) +#define GTK_INSPECTOR_IS_RECORDER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TYPE_INSPECTOR_RECORDER)) +#define GTK_INSPECTOR_RECORDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_INSPECTOR_RECORDER, GtkInspectorRecorderClass)) + + +typedef struct _GtkInspectorRecorderPrivate GtkInspectorRecorderPrivate; + +typedef struct _GtkInspectorRecorder +{ + GtkBin parent; +} GtkInspectorRecorder; + +typedef struct _GtkInspectorRecorderClass +{ + GtkBinClass parent; +} GtkInspectorRecorderClass; + +G_BEGIN_DECLS + +GType gtk_inspector_recorder_get_type (void); + +G_END_DECLS + +#endif // _GTK_INSPECTOR_RECORDER_H_ + +// vim: set et sw=2 ts=2: diff --git a/gtk/inspector/recorder.ui b/gtk/inspector/recorder.ui new file mode 100644 index 0000000000..ca23b23cfe --- /dev/null +++ b/gtk/inspector/recorder.ui @@ -0,0 +1,25 @@ + + + + + + diff --git a/gtk/inspector/window.c b/gtk/inspector/window.c index fcbc33fff2..9f84a5c52f 100644 --- a/gtk/inspector/window.c +++ b/gtk/inspector/window.c @@ -263,6 +263,7 @@ gtk_inspector_window_class_init (GtkInspectorWindowClass *klass) gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, child_prop_list); gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, signals_list); gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, widget_css_node_tree); + gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, widget_recorder); gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, object_hierarchy); gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, object_title); gtk_widget_class_bind_template_child (widget_class, GtkInspectorWindow, selector); diff --git a/gtk/inspector/window.h b/gtk/inspector/window.h index 8aef581ede..13d066a4e6 100644 --- a/gtk/inspector/window.h +++ b/gtk/inspector/window.h @@ -60,6 +60,7 @@ typedef struct GtkWidget *style_prop_list; GtkWidget *classes_list; GtkWidget *widget_css_node_tree; + GtkWidget *widget_recorder; GtkWidget *object_hierarchy; GtkWidget *size_groups; GtkWidget *data_list; diff --git a/gtk/inspector/window.ui b/gtk/inspector/window.ui index 226a707403..6228375de4 100644 --- a/gtk/inspector/window.ui +++ b/gtk/inspector/window.ui @@ -130,6 +130,14 @@ css + + + 1 + + + recorder + + 1 @@ -447,6 +455,15 @@ CSS + + + True + + + recorder + Recorder + + True -- 2.30.2